<template>
	<view class="pages">
		<view class="bac"></view>
		<view class="outer">
			<view class="success-wrap">
				<view class="success-icon">
					<view class="circle"></view>
					<view class="check"></view>
				</view>
				<view class="pay-title">支付成功</view>
				<view class="amount">{{ amount }}</view>
				<view class="order-row">
					<view class="label">预约编号：</view>
					<view class="value">{{ orderNo }}</view>
				</view>

				<button class="btn primary" @click="goHome">返回首页</button>
				<button class="btn ghost" @click="goDetail">订单详情</button>
			</view>
		</view>
	</view>
</template>

<script setup>
	import { ref } from 'vue'
	const amount = ref('39.90')
	const orderNo = ref('324252536363634')

	const goHome = () => {
		uni.switchTab({
			url: '/pages/index/index'
		})
	}

	const goDetail = () => {
		uni.showToast({
			title: '跳转订单详情',
			icon: 'none'
		})
	}
</script>

<style>
.pages {
		background-color: white;
	}

	.bac {
		background-color: #2b85e4;
		height: 200rpx;
	}

	.outer {
		margin-top: -140rpx;
		background-color: white;
		width: 92%;
		border-radius: 20rpx;
		margin-left: 30rpx;
		padding: 20rpx 0 40rpx;
	}

	.success-wrap{
		background-color: #fff;
		border-radius: 20rpx;
		padding: 60rpx 40rpx 40rpx;
		box-shadow: 0 6rpx 20rpx rgba(0,0,0,0.05);
	}

	.success-icon{
		width: 160rpx;
		height: 160rpx;
		border-radius: 50%;
		margin: 0 auto;
		position: relative;
		background: linear-gradient(180deg,#5aa9ff,#2b85e4);
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.circle{
		position: absolute;
		inset: 8rpx;
		border-radius: 50%;
		background: linear-gradient(180deg,#7bbaff,#3e93ee);
		opacity: .15;
	}

	.check{
		width: 50rpx;
		height: 26rpx;
		border-left: 8rpx solid #fff;
		border-bottom: 8rpx solid #fff;
		transform: rotate(-45deg);
		z-index: 1;
	}

	.pay-title{
		text-align: center;
		margin-top: 30rpx;
		font-size: 34rpx;
		color: #333;
		font-weight: 600;
	}

	.amount{
		text-align: center;
		margin-top: 20rpx;
		font-size: 64rpx;
		color: #000;
		font-weight: 800;
	}

	.order-row{
		display: flex;
		justify-content: center;
		align-items: center;
		margin-top: 30rpx;
		color: #666;
		font-size: 26rpx;
	}

	.order-row .label{
		margin-right: 8rpx;
	}

	.btn{
		margin: 60rpx 40rpx 0;
		height: 88rpx;
		border-radius: 44rpx;
		font-size: 30rpx;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.primary{
		background-color: #0a60ff;
		color: #fff;
	}

	.ghost{
		background-color: #e5e5e5;
		color: #9c9c9c;
	}
</style>